/*
 * Code for blog.techhead.biz
 * Distributed under BSD-style license
 */
package biz.techhead.jdbc;

import java.sql.SQLException;

/**
 *
 * @author Jonathan Hawkes <jhawkes at techhead.biz>
 */
public class DBException extends RuntimeException {

    public DBException() {
    }

    public DBException(String msg) {
        super(msg);
    }

    public DBException(String msg, Throwable cause) {
        super(msg, cause);
    }

    void throwSQLException() throws SQLException {
        if (getCause() instanceof SQLException)
            throw (SQLException) getCause();
        throw new SQLException(getMessage(), this);
    }
}
